package com.cdd.goods.controller;

import com.cdd.goods.service.IGoodsBrandService;
import com.common.entity.GoodsBrand;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-01
 */
@RestController
@RequestMapping("/goods/goodsBrand")
public class GoodsBrandController {
    @Autowired
    private IGoodsBrandService iGoodsBrandService;
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody GoodsBrand goodsBrand){
        return iGoodsBrandService.selectAll(currentPage,pageSize,goodsBrand);
    }
    @PostMapping("/select")
    public CommonResult select(){
        return iGoodsBrandService.select();
    }
    @PostMapping("/delectGoodsBrand/{id}")
    public CommonResult delectGoodsBrand(@PathVariable Integer id){
        return iGoodsBrandService.delectGoodsBrand(id);
    }
    @PostMapping("/updateGoodsBrand")
    public CommonResult updateGoodsBrand(@RequestBody GoodsBrand goodsBrand){
        return iGoodsBrandService.updateGoodsBrand(goodsBrand);
    }
    @PostMapping("/insertGoods")
    public CommonResult insertGoods(@RequestBody GoodsBrand goodsBrand){
        return iGoodsBrandService.insertGoods(goodsBrand);
    }
}
